<div class="form-group">
	<label for="exampleInputEmail1">Mã xác thực</label>
	<img id='captcha' src="<?= $this->webroot; ?>Captchas/?name=<?php echo $name; ?>&rand=<?php echo rand();?>" alt="" />
    <a href="javascript:void(0)" onclick="reload_captcha('<?php echo $name; ?>')">
    	<span class="glyphicon glyphicon-refresh"></span>
    </a>
	<?php echo $this->Form->input( 'captcha', array('label' => false, 'div' => false, 'class' => 'form-control' )); ?>
</div>


<script type="text/javascript">
function reload_captcha($name)
{
    jQuery('#captcha').attr('src', '<?= $this->webroot; ?>Captchas/?name=<?php echo $name; ?>&rand=' + Math.random());
}
</script>